\(\int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx\) [921]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 114 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {c^4 x}{a^3}-\frac {i c^4 \log (\cos (e+f x))}{a^3 f}+\frac {8 i c^4}{3 f (a+i a \tan (e+f x))^3}-\frac {6 i c^4}{a f (a+i a \tan (e+f x))^2}+\frac {6 i c^4}{f \left (a^3+i a^3 \tan (e+f x)\right )} \]

[Out]

-c^4*x/a^3-I*c^4*ln(cos(f*x+e))/a^3/f+8/3*I*c^4/f/(a+I*a*tan(f*x+e))^3-6*I*c^4/a/f/(a+I*a*tan(f*x+e))^2+6*I*c^
4/f/(a^3+I*a^3*tan(f*x+e))

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\frac {6 i c^4}{f \left (a^3+i a^3 \tan (e+f x)\right )}-\frac {i c^4 \log (\cos (e+f x))}{a^3 f}-\frac {c^4 x}{a^3}-\frac {6 i c^4}{a f (a+i a \tan (e+f x))^2}+\frac {8 i c^4}{3 f (a+i a \tan (e+f x))^3} \]

[In]

Int[(c - I*c*Tan[e + f*x])^4/(a + I*a*Tan[e + f*x])^3,x]

[Out]

-((c^4*x)/a^3) - (I*c^4*Log[Cos[e + f*x]])/(a^3*f) + (((8*I)/3)*c^4)/(f*(a + I*a*Tan[e + f*x])^3) - ((6*I)*c^4
)/(a*f*(a + I*a*Tan[e + f*x])^2) + ((6*I)*c^4)/(f*(a^3 + I*a^3*Tan[e + f*x]))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps \begin{align*} \text {integral}& = \left (a^4 c^4\right ) \int \frac {\sec ^8(e+f x)}{(a+i a \tan (e+f x))^7} \, dx \\ & = -\frac {\left (i c^4\right ) \text {Subst}\left (\int \frac {(a-x)^3}{(a+x)^4} \, dx,x,i a \tan (e+f x)\right )}{a^3 f} \\ & = -\frac {\left (i c^4\right ) \text {Subst}\left (\int \left (\frac {1}{-a-x}+\frac {8 a^3}{(a+x)^4}-\frac {12 a^2}{(a+x)^3}+\frac {6 a}{(a+x)^2}\right ) \, dx,x,i a \tan (e+f x)\right )}{a^3 f} \\ & = -\frac {c^4 x}{a^3}-\frac {i c^4 \log (\cos (e+f x))}{a^3 f}+\frac {8 i c^4}{3 f (a+i a \tan (e+f x))^3}-\frac {6 i c^4}{a f (a+i a \tan (e+f x))^2}+\frac {6 i c^4}{f \left (a^3+i a^3 \tan (e+f x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 5.51 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.61 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {i c^4 \left (-\log (i-\tan (e+f x))+\frac {2 \left (-4 i+9 \tan (e+f x)+9 i \tan ^2(e+f x)\right )}{3 (-i+\tan (e+f x))^3}\right )}{a^3 f} \]

[In]

Integrate[(c - I*c*Tan[e + f*x])^4/(a + I*a*Tan[e + f*x])^3,x]

[Out]

((-I)*c^4*(-Log[I - Tan[e + f*x]] + (2*(-4*I + 9*Tan[e + f*x] + (9*I)*Tan[e + f*x]^2))/(3*(-I + Tan[e + f*x])^
3)))/(a^3*f)

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.96

method result size
derivativedivides \(\frac {6 c^{4}}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )}+\frac {6 i c^{4}}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {8 c^{4}}{3 f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{3}}+\frac {i c^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \,a^{3}}-\frac {c^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}\) \(110\)
default \(\frac {6 c^{4}}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )}+\frac {6 i c^{4}}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {8 c^{4}}{3 f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{3}}+\frac {i c^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \,a^{3}}-\frac {c^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}\) \(110\)
risch \(\frac {i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )}}{a^{3} f}-\frac {i c^{4} {\mathrm e}^{-4 i \left (f x +e \right )}}{2 a^{3} f}+\frac {i c^{4} {\mathrm e}^{-6 i \left (f x +e \right )}}{3 a^{3} f}-\frac {2 c^{4} x}{a^{3}}-\frac {2 c^{4} e}{a^{3} f}-\frac {i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a^{3} f}\) \(110\)
norman \(\frac {\frac {4 i c^{4} \left (\tan ^{2}\left (f x +e \right )\right )}{a f}-\frac {c^{4} x}{a}+\frac {8 i c^{4}}{3 a f}-\frac {8 c^{4} \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}+\frac {6 c^{4} \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {3 c^{4} x \left (\tan ^{2}\left (f x +e \right )\right )}{a}-\frac {3 c^{4} x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {c^{4} x \left (\tan ^{6}\left (f x +e \right )\right )}{a}+\frac {2 c^{4} \tan \left (f x +e \right )}{a f}+\frac {12 i c^{4} \left (\tan ^{4}\left (f x +e \right )\right )}{a f}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}+\frac {i c^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \,a^{3}}\) \(209\)

[In]

int((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

6/f*c^4/a^3/(tan(f*x+e)-I)+6*I/f*c^4/a^3/(tan(f*x+e)-I)^2-8/3/f*c^4/a^3/(tan(f*x+e)-I)^3+1/2*I/f*c^4/a^3*ln(1+
tan(f*x+e)^2)-1/f*c^4/a^3*arctan(tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.82 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {{\left (12 \, c^{4} f x e^{\left (6 i \, f x + 6 i \, e\right )} + 6 i \, c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 6 i \, c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 i \, c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, c^{4}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6 \, a^{3} f} \]

[In]

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/6*(12*c^4*f*x*e^(6*I*f*x + 6*I*e) + 6*I*c^4*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 6*I*c^4*e^(4
*I*f*x + 4*I*e) + 3*I*c^4*e^(2*I*f*x + 2*I*e) - 2*I*c^4)*e^(-6*I*f*x - 6*I*e)/(a^3*f)

Sympy [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.86 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\begin {cases} \frac {\left (6 i a^{6} c^{4} f^{2} e^{10 i e} e^{- 2 i f x} - 3 i a^{6} c^{4} f^{2} e^{8 i e} e^{- 4 i f x} + 2 i a^{6} c^{4} f^{2} e^{6 i e} e^{- 6 i f x}\right ) e^{- 12 i e}}{6 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (\frac {2 c^{4}}{a^{3}} + \frac {\left (- 2 c^{4} e^{6 i e} + 2 c^{4} e^{4 i e} - 2 c^{4} e^{2 i e} + 2 c^{4}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} - \frac {2 c^{4} x}{a^{3}} - \frac {i c^{4} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} \]

[In]

integrate((c-I*c*tan(f*x+e))**4/(a+I*a*tan(f*x+e))**3,x)

[Out]

Piecewise(((6*I*a**6*c**4*f**2*exp(10*I*e)*exp(-2*I*f*x) - 3*I*a**6*c**4*f**2*exp(8*I*e)*exp(-4*I*f*x) + 2*I*a
**6*c**4*f**2*exp(6*I*e)*exp(-6*I*f*x))*exp(-12*I*e)/(6*a**9*f**3), Ne(a**9*f**3*exp(12*I*e), 0)), (x*(2*c**4/
a**3 + (-2*c**4*exp(6*I*e) + 2*c**4*exp(4*I*e) - 2*c**4*exp(2*I*e) + 2*c**4)*exp(-6*I*e)/a**3), True)) - 2*c**
4*x/a**3 - I*c**4*log(exp(2*I*f*x) + exp(-2*I*e))/(a**3*f)

Maxima [F(-2)]

Exception generated. \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.78 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.61 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {\frac {30 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} - \frac {60 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} + \frac {30 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} + \frac {147 i \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 1002 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 i \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3820 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 i \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1002 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 i \, c^{4}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}}{30 \, f} \]

[In]

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="giac")

[Out]

-1/30*(30*I*c^4*log(tan(1/2*f*x + 1/2*e) + 1)/a^3 - 60*I*c^4*log(tan(1/2*f*x + 1/2*e) - I)/a^3 + 30*I*c^4*log(
tan(1/2*f*x + 1/2*e) - 1)/a^3 + (147*I*c^4*tan(1/2*f*x + 1/2*e)^6 + 1002*c^4*tan(1/2*f*x + 1/2*e)^5 - 2445*I*c
^4*tan(1/2*f*x + 1/2*e)^4 - 3820*c^4*tan(1/2*f*x + 1/2*e)^3 + 2445*I*c^4*tan(1/2*f*x + 1/2*e)^2 + 1002*c^4*tan
(1/2*f*x + 1/2*e) - 147*I*c^4)/(a^3*(tan(1/2*f*x + 1/2*e) - I)^6))/f

Mupad [B] (verification not implemented)

Time = 5.42 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.90 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {\frac {6\,c^4\,\mathrm {tan}\left (e+f\,x\right )}{a^3}-\frac {c^4\,8{}\mathrm {i}}{3\,a^3}+\frac {c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2\,6{}\mathrm {i}}{a^3}}{f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+1\right )}+\frac {c^4\,\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{a^3\,f} \]

[In]

int((c - c*tan(e + f*x)*1i)^4/(a + a*tan(e + f*x)*1i)^3,x)

[Out]

(c^4*log(tan(e + f*x) - 1i)*1i)/(a^3*f) - ((6*c^4*tan(e + f*x))/a^3 - (c^4*8i)/(3*a^3) + (c^4*tan(e + f*x)^2*6
i)/a^3)/(f*(tan(e + f*x)*3i - 3*tan(e + f*x)^2 - tan(e + f*x)^3*1i + 1))